package com.wzy.netty.core.inboundhandlerandoutboundhandler;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

/**
 * 描述  :
 * 创建人 :    Wzy
 * 创建时间: 2020-06-11  23:10
 */
public class MyLongToByteEncoder extends MessageToByteEncoder<Long> {
    @Override
    protected void encode(ChannelHandlerContext channelHandlerContext, Long aLong, ByteBuf byteBuf) throws Exception {
        System.out.println("MyLongToByteEncoder encode被调用");
        System.out.println("msg=" + aLong);
        byteBuf.writeLong(aLong);

    }
}
